Skip to content

Document explicit prompt caching support in ChatOpenAI#4829

Open
langsmith-fleet[bot] wants to merge 2 commits into
mainfrom
docs/openai-explicit-prompt-caching
Open

Document explicit prompt caching support in ChatOpenAI#4829
langsmith-fleet[bot] wants to merge 2 commits into
mainfrom
docs/openai-explicit-prompt-caching

Conversation

@langsmith-fleet

Copy link
Copy Markdown
Contributor

Fixes DOC-1363

Summary

  • Adds a new subsection "Explicit caching with breakpoints (Responses API)" to the Prompt caching section of the ChatOpenAI docs page, documenting the prompt_cache_breakpoint field on text, image, and file content blocks
  • Adds a "Request-level cache options" subsection documenting the new prompt_cache_options model parameter
  • Adds a "Cache write tokens" subsection documenting cache_creation in input_token_details usage metadata, including priority/flex service-tier variants

These features were added in langchain-ai/langchain#38762 (langchain-openai>=1.3.5, openai>=2.45.0).

Links

Verification

Cross-references checked: make check-cross-refs passed ✅. Vale not available in sandbox (brew dependency), but the content is prose-only additions with no structural changes.

Reviewers

Requested review from: Mason Daugherty (@mdrxy) (integrations owner)

@github-actions github-actions Bot added langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects external User is not a member of langchain-ai labels Jul 10, 2026
### Explicit caching with breakpoints (Responses API)

<Note>
Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api).
Requires `langchain-openai>=1.3.5`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is done transitively

### Explicit caching with breakpoints (Responses API)

<Note>
Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only supported when using the Responses API.

need to verify this claim

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

```python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="gpt-4.1", use_responses_api=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
llm = ChatOpenAI(model="gpt-4.1", use_responses_api=True)
llm = ChatOpenAI(model="gpt-5.6-sol", use_responses_api=True)

need to verify model string

don't think 4.1 supports


```python
llm = ChatOpenAI(
model="gpt-4.1",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change

@npentrel Naomi Pentrel (npentrel) force-pushed the docs/openai-explicit-prompt-caching branch from 96e3151 to b5b0943 Compare July 12, 2026 09:03
@github-actions github-actions Bot added the ci label Jul 12, 2026
@npentrel Naomi Pentrel (npentrel) force-pushed the docs/openai-explicit-prompt-caching branch from b5b0943 to 30c56e3 Compare July 12, 2026 09:05
@npentrel Naomi Pentrel (npentrel) force-pushed the docs/openai-explicit-prompt-caching branch from 30c56e3 to d5f71a5 Compare July 12, 2026 09:07
@npentrel Naomi Pentrel (npentrel) marked this pull request as ready for review July 12, 2026 09:07
@github-actions

Copy link
Copy Markdown
Contributor

Mintlify preview branch generated: preview-docsop-1783847326-6a62893

Site preview: https://langchain-5e9cc07a-preview-docsop-1783847326-6a62893.mintlify.app

Important

Preview links may take a few minutes to start working while the deployment finishes.

Changed documentation pages (preview deep links):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci external User is not a member of langchain-ai langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants